package com.sq.partner.manager.service;

import java.util.Map;

import com.sq.partner.manager.mybatis.model.FacadeUser;
import com.sq.partner.manager.mybatis.model.GatewaySubChannel;
import com.sq.partner.manager.mybatis.model.GatewayUser;
import com.sq.partner.manager.util.Page;

public interface IFacadeUserService {

	/**
	 * 分页查询所有用户
	 * @param page
	 * @param pageIndex
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public Page queryPage(Page page,Integer pageIndex, FacadeUser user) throws Exception;
	
	/**
	 * 新增用户
	 * @param user
	 * @return
	 * @throws Exception
	 */
	boolean addUser(FacadeUser user) throws Exception;
	
	/**
	 * 根据某个条件查询返回结果的数据条数
	 * @param user
	 * @return
	 * @throws Exception
	 */
	FacadeUser queryUserCountByMap(Map<String,String> map) throws Exception;
	
	/**
	 * 修改用户信息
	 * @param user
	 * @return
	 * @throws Exception
	 */
	boolean saveUser(FacadeUser user) throws Exception;
	
	/**
	 * 根据用户ID查询用户信息
	 * @param userid
	 * @return
	 * @throws Exception
	 */
	FacadeUser queryUserById(Long userid) throws Exception;
	
	/**
	 * 根据用户id删除
	 * @param userid
	 * @throws Exception
	 */
	boolean delUserById(Long userid) throws Exception;
	
	/**
	 * 查询当前用户角色配置的机构下的合作伙伴列表
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public Page<GatewaySubChannel> queryChannelListByDeptForTree(GatewayUser user,Page<GatewaySubChannel> page) throws Exception;	

	boolean updateUser(FacadeUser user) throws Exception;
	
	/**
	 * 根据用户名删除
	 * @param userid
	 * @throws Exception
	 */
	boolean delUserByUserCodeAndUserType(String userCode, String userType) throws Exception;
	
	boolean delUserBySubChannelCodeAndUserType(String subChannelCode, String userType) throws Exception;
}
